package com.core
{
	import com.event.GameEvent;
	
	import flash.display.Sprite;

	public class UIScreen extends Sprite
	{
		private var view:*
		public function UIScreen()
		{
			super();
		}
		public function createUI($view:Class):void{
			view = new $view;
			addChild(view);
		}
		public function handleGame(e:GameEvent):void{
			switch(e.type){
				case GameEvent.GAME_UPDATE_LEVEL_EVENT:{
					view.level_txt.htmlText = String(e.level);
					break;
				};
				case GameEvent.GAME_UPDATE_LIFE_EVENT:{
					view.life_txt.htmlText = e.life;
					break;
				};
				case GameEvent.GAME_UPDATE_SCORE_EVENT:{
					view.score_txt.htmlText = e.score;
					break;
				}
				case GameEvent.GAME_UPDATE_TIME_EVENT:{
					view.time_txt.htmlText = e.time;
					break;
				}
			}
		}
	}
}